home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_337 / cmanual / requesters.lzh / Requesters / Example1.c < prev    next >
C/C++ Source or Header  |  1990-01-30  |  4KB  |  94 lines

  1. /* Example1                                                            */
  2. /* This example opens a Simple requester by calling the function       */
  3. /* AutoRequest. It displays a message "This is a very simple           */
  4. /* requester!", and has one gadget connected to it (on the right side) */
  5. /* with the text "OK".                                                 */
  6.  
  7.  
  8.  
  9. #include <intuition/intuition.h>
  10.  
  11.  
  12.  
  13. struct IntuitionBase *IntuitionBase;
  14.  
  15.  
  16.  
  17. /* The body text for the requester: */
  18. struct IntuiText my_body_text=
  19. {
  20.   0,       /* FrontPen, colour 0 (blue). */
  21.   0,       /* BackPen, not used since JAM1. */
  22.   JAM1,    /* DrawMode, do not change the background. */
  23.   15,      /* LedtEdge, 15 pixels out. */
  24.   5,       /* TopEdge, 5 lines down. */
  25.   NULL,    /* ITextFont, default font. */
  26.   "This is a very simple requester!", /* IText, the text . */
  27.   NULL,    /* NextText, no more IntuiText structures link. */
  28. };
  29.  
  30. /* The OK text: */
  31. struct IntuiText my_ok_text=
  32. {
  33.   0,       /* FrontPen, colour 0 (blue). */
  34.   0,       /* BackPen, not used since JAM1. */
  35.   JAM1,    /* DrawMode, do not change the background. */
  36.   6,       /* LedtEdge, 6 pixels out. */
  37.   3,       /* TopEdge, 3 lines down. */
  38.   NULL,    /* ITextFont, default font. */
  39.   "OK",    /* IText, the text that will be printed. */
  40.   NULL,    /* NextText, no more IntuiText structures link. */
  41. };
  42.  
  43.  
  44.  
  45. main()
  46. {
  47.   /* Before we can use Intuition we need to open the Intuition Library: */
  48.   IntuitionBase = (struct IntuitionBase *)
  49.     OpenLibrary( "intuition.library", 0 );
  50.   
  51.   if( IntuitionBase == NULL )
  52.     exit(); /* Could NOT open the Intuition Library! */
  53.  
  54.  
  55.  
  56.   AutoRequest(NULL, &my_body_text, NULL, &my_ok_text, NULL, NULL, 320, 72);
  57.  
  58.   /***********************************************************************/
  59.   /* NULL,              no pointer to a window structure.                */
  60.   /* &my_body_text,     pointer to a IntuiText str. cont. the body text  */
  61.   /* NULL,              no gadget on the right side.                     */
  62.   /* &my_ok_text,       pointer to a IntuiText str. cont. the neg. text  */
  63.   /* NULL,              no gadget on the right side.                     */
  64.   /* NULL,              IDCMP flags which will satisfy the negative gad. */
  65.   /* 320,               Width, 320 pixels wide.                          */
  66.   /* 72,                Height, 72 lines high.                           */
  67.   /*                                                                     */
  68.   /* Intuition will automatically set the IDCMP flag RELVERIFY for both  */
  69.   /* of the gadgets, so we do not need to set any IDCMP flags if we do   */
  70.   /* not want to.                                                        */
  71.   /*                                                                     */
  72.   /* The requester will look like this:                                  */
  73.   /*                                                                     */
  74.   /* ---------------------------------------                             */
  75.   /* | System Request ================[*][*]                             */
  76.   /* ---------------------------------------                             */
  77.   /* | This is a very simple requester! |  |                             */
  78.   /* |                                  |  |                             */
  79.   /* |                                  |  |                             */
  80.   /* |                           ------ |  |                             */
  81.   /* |                           | OK | |  |                             */
  82.   /* |                           ------ |  |                             */
  83.   /* ------------------------------------[*]                             */
  84.   /*                                                                     */
  85.   /***********************************************************************/
  86.  
  87.  
  88.  
  89.   /* Close the Intuition Library since we have opened it: */
  90.   CloseLibrary( IntuitionBase );
  91.   
  92.   /* THE END */
  93. }
  94.